package com.ship.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
/**
 * 国内采购物料上船
 * @author wqf
 * @version  Nov 24, 2011 9:49:12 AM
 */
@Entity
@org.hibernate.annotations.Entity(
		selectBeforeUpdate = true, 
		dynamicInsert = true, 
		dynamicUpdate = true
)
@Table(name="ship_mainland_material")
public class MainlandMaterial implements Serializable {
		

	/**
	 * 
	 */
	private static final long serialVersionUID = -8339003340081589576L;

	@Id
	@GeneratedValue
	private Long id;
	
	/**
	 * 开始日期
	 */
	@Temporal(TemporalType.TIMESTAMP)
	private Date startDate;
	
	/**
	 * 创建日期
	 */
	@Column(updatable=false)
	@Temporal(TemporalType.TIMESTAMP)
	private Date createDate;
		
	/**
	 * 材料编码
	 */
	@ManyToOne
	@JoinColumn(name="material_id",referencedColumnName="id")
	private ShipMaterial material = new ShipMaterial();
	
	/**
	 *规格型号
	 */
	@Column(length=100)
	private String format;
	
	/**
	 *计量单位
	 */
	@Column(length=50)
	private String unit;
	
	/**
	 *数量
	 */
	@Column(length=10)
	private Integer amount;
	
	public Double getUnitprice() {
		return unitprice;
	}

	public void setUnitprice(Double unitprice) {
		this.unitprice = unitprice;
	}

	public Double getMoney() {
		return money;
	}

	public void setMoney(Double money) {
		this.money = money;
	}

	/**
	 *单价
	 */
	@Column(length=11)
	private Double unitprice;
	
	/**
	 *金额
	 */
	@Column
	private Double money;
	
	/**
	 *备注
	 */
	@Column(length=500)
	private String remark;
	
	/**
	 * 状态
	 */
	@Column
	private Boolean status;
		
	@ManyToOne
	@JoinColumn(name="ship_info_id",referencedColumnName="id")
	private ShipInfo shipInfo=new ShipInfo();

	@ManyToOne
	@JoinColumn(name="user_id",referencedColumnName="id")
	private User user = new User();
	
	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}
	
	public ShipMaterial getMaterial() {
		return material;
	}

	public void setMaterial(ShipMaterial material) {
		this.material = material;
	}

	public String getFormat() {
		return format;
	}

	public void setFormat(String format) {
		this.format = format;
	}

	public String getUnit() {
		return unit;
	}

	public void setUnit(String unit) {
		this.unit = unit;
	}

	public Integer getAmount() {
		return amount;
	}

	public void setAmount(Integer amount) {
		this.amount = amount;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}
	
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Date getStartDate() {
		return startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	public Boolean getStatus() {
		return status;
	}

	public void setStatus(Boolean status) {
		this.status = status;
	}

	public ShipInfo getShipInfo() {
		return shipInfo;
	}

	public void setShipInfo(ShipInfo shipInfo) {
		this.shipInfo = shipInfo;
	}
		

}
